import request from '@/utils/request'

const API = {
  // 获取已保存的样本列表
  getSavedSamples: () => {
    return request({
      url: '/similaritySearchSample/queryList',
      method: 'get'
    })
  },

  // 新增样本
  addSample: (data: any) => {
    return request({
      url: '/similaritySearchSample/addSample',
      method: 'post',
      data
    })
  },

  // 更新样本
  updateSample: (data: any) => {
    return request({
      url: '/similaritySearchSample/updateSample',
      method: 'post',
      data
    })
  },

  // 删除样本
  deleteSample: (id: string) => {
    return request({
      url: `/similaritySearchSample/removeSample?id=${id}`,
      method: 'get'
    })
  },

  // 相似性检索
  searchSimilarity: (data: any) => {
    return request({
      url: '/similaritySearchSample/searchDataBySample',
      method: 'post',
      data
    })
  },

  // 获取检索配置信息
  getSearchConfig: () => {
    return request({
      url: '/similaritySearchSample/getSearchSettings',
      method: 'get'
    })
  },
  //修改配置
  updateSearchConfig: (data: any) => {
    return request({
      url: '/similaritySearchSample/updateSearchSettings',
      method: 'post',
      data
    })
  }
}

export default API